package org.jeecg.modules.engineering.service.impl;

import org.jeecg.modules.engineering.entity.EquipCollectRelation;
import org.jeecg.modules.engineering.mapper.EquipCollectRelationMapper;
import org.jeecg.modules.engineering.service.IEquipCollectRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 设备与采集项关系表
 * @Author: jeecg-boot
 * @Date:   2019-08-27
 * @Version: V1.0
 */
@Service
public class EquipCollectRelationServiceImpl extends ServiceImpl<EquipCollectRelationMapper, EquipCollectRelation> implements IEquipCollectRelationService {

    @Autowired
    private EquipCollectRelationMapper equipCollectRelationMapper;

    @Override
    public List<String> getItemListByEquipId(String equipId) {
        return equipCollectRelationMapper.getItemListByEquipId(equipId);
    }

    @Override
    public boolean checkHaveByItemIds(List<String> ids) {
        long count = equipCollectRelationMapper.selectCountByItemIds(ids,ids.size());
        return count > 0;
    }
}
